/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * SystemSettingPanel.java
 *
 * Created on 2011-4-22, 13:36:14
 */

package com.iduxs.collect.frame.system;

import com.iduxs.collect.frame.MainFrame;
import java.awt.Component;

/**
 *
 * @author Administrator
 */
public class SystemSettingPanel extends javax.swing.JPanel {

    private MainFrame mainFrame;

    /** Creates new form SystemSettingPanel */
    public SystemSettingPanel(MainFrame _mainFrame) {
        this.mainFrame = _mainFrame;
        initComponents();
        init();
    }

    private void init() {
        BasedSettingPanel basedSettingPanel = new BasedSettingPanel();
        mainTabs.add("基本设置", basedSettingPanel);
        CategoriesPanel categoriesPanel = new CategoriesPanel();
        mainTabs.add("分类对应", categoriesPanel);
        GenerateSettingPanel generateSettingPanel = new GenerateSettingPanel();
        mainTabs.add("生成设置", generateSettingPanel);
        EbookSettingPanel ebookSettingPanel = new EbookSettingPanel();
        mainTabs.add("电子书设置", ebookSettingPanel);
        ImageSettingPanel imageSettingPanel = new ImageSettingPanel();
        mainTabs.add("图片设置", imageSettingPanel);
        TextAdvertisePanel textAdvertisePanel = new TextAdvertisePanel();
        mainTabs.add("文字广告",textAdvertisePanel);
        ReplacePanel replacePanel = new ReplacePanel();
        mainTabs.add("过滤替换",replacePanel);
    }

    public void showTabByTitle(String title) {
        int count = mainTabs.getTabCount();
        for (int i=0;i<count;i++) {
            if (mainTabs.getTitleAt(i).equals(title)) {
                mainTabs.setSelectedIndex(i);
                break;
            }
        }
    }
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        mainTabs = new javax.swing.JTabbedPane();

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(mainTabs, javax.swing.GroupLayout.DEFAULT_SIZE, 630, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(mainTabs, javax.swing.GroupLayout.DEFAULT_SIZE, 394, Short.MAX_VALUE)
        );
    }// </editor-fold>//GEN-END:initComponents


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTabbedPane mainTabs;
    // End of variables declaration//GEN-END:variables

}
